<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="com.weifly.jettycn.domain.Catalog" %>
<%@ page import="com.weifly.jettycn.util.TreeNode" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录页面</title>
    <%@include file="/comhead.jsp" %>
    <script type="text/javascript">

	function loginHandler(){
		$("#loginForm").ajaxSubmit(function(response, statusText){
			response = $.parseJSON(response);
			if(response.success){
				window.location.assign("console/main.do");
			}else{
				alert("登录失败：" + response.messages.join("\n"));
			}
		});
	}
    
    $(document).ready(function(){
		$("#user_submit").click(loginHandler);
    });
    </script>
  </head>
  <body>
    <form id="loginForm" action="checkUser.do" method="post">
    <table class="table_show1" border="1px" bordercolor="#ccbbaa">
      <tr>
        <td>用户名称：</td>
        <td>
          <input id="user_name" name="user_name" style="width: 240px;">
        </td>
      </tr>
      <tr>
        <td>用户密码：</td>
        <td>
          <input id="user_password" name="user_password" type="password" style="width: 240px;">
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <button id="user_submit" type="button">登录</button>
        </td>
      </tr>
    </table>
    </form>
  </body>
</html>